package com.web.webstart.base.util.result;


import com.alibaba.fastjson.JSON;
import com.web.webstart.base.constant.XaConstant;

/**
 * Created by duandazhi on 2017/1/6.
 */
public class CmsResult {

    private int status = XaConstant.Code.success;//取值1,0;默认sucess
    private String result;

    public CmsResult() {
    }

    public CmsResult(String result) {
        this.result = result;
    }

    public CmsResult(int status, String result) {
        this.status = status;
        this.result = result;
    }

    public static CmsResult error(String result) {
        return new CmsResult(XaConstant.Code.error, result);
    }

    public int getStatus() {
        return status;
    }

    public void setStatus(int status) {
        this.status = status;
    }

    public String getResult() {
        return result;
    }

    public void setResult(String result) {
        this.result = result;
    }

    @Override
    public String toString() {
        return JSON.toJSONString(this);
    }
}
